#include<vtkActor.h>
#include<vtkCamera.h>
#include<vtkConeSource.h>
#include<vtkNamedColors.h>
#include<vtkNew.h>
#include<vtkPolyDataMapper.h>
#include<vtkRenderWindow.h>
#include<vtkRenderer.h>

int _main(int, char* []) {
	vtkNew<vtkNamedColors> colors;
	
	vtkNew<vtkConeSource> cone;
	cone->SetHeight(3.0);
	cone->SetRadius(1.0);
	cone->SetResolution(10);
	
	vtkNew<vtkPolyDataMapper> coneMapper;
	coneMapper->SetInputConnection(cone->GetOutputPort());
	
	vtkNew<vtkActor> coneActor;
	coneActor->SetMapper(coneMapper);
	
	vtkNew<vtkRenderer> ren1;
	ren1->AddActor(coneActor);
	ren1->SetBackground(colors->GetColor3d("MidnightBlue").GetData());
	
	vtkNew<vtkRenderWindow> renWin;
	renWin->AddRenderer(ren1);
	renWin->SetSize(300, 300);

	for (auto i = 0; i < 360; ++i) {
		// render the image
		renWin->Render();
		// rotate the active camera by one degree
		ren1->GetActiveCamera()->Azimuth(1);
	}
	return EXIT_SUCCESS;
}